<template>
  <VPage>
    <div class="mx-[10px]">
      <el-tabs v-model="activeName">
        <el-tab-pane label="备货订单" name="1"></el-tab-pane>
        <el-tab-pane label="客户订单" name="2"></el-tab-pane>
      </el-tabs>
    </div>
    <template v-if="activeName == 1">
      <StockingOrder :optionsData="optionsData" />
    </template>
    <template v-else>
      <CustomerOrder :optionsData="optionsData" />
    </template>
  </VPage>
</template>
<script setup lang="jsx">
import { ElMessage } from "element-plus";
import StockingOrder from "./components/StockingOrder/index";
import CustomerOrder from "./components/CustomerOrder/index";
import { getChannelList, logisticsList, getCountry } from "@/api/index.js";
const activeName = ref("1");

const optionsData = reactive({});
//获取物流商
const getlogistics = () => {
  logisticsList({}).then((res) => {
    optionsData.logistics = res?.data || [];
  });
};
getlogistics();
const getChannel = async () => {
  const { data } = await getChannelList();
  optionsData.channel = data;
};
getChannel();
const getCountryList = async () => {
  const { data } = await getCountry();
  optionsData.country = data;
};
getCountryList();
</script>
<style scoped lang="scss">
:deep(.el-tabs__header) {
  margin: 0;
}
</style>

